
<div id="roleMenuData" class="demo-tree demo-tree-box"></div>


<script>
    layui.use('tree', function() {
        var tree = layui.tree
            ,layer = layui.layer
            ,util = layui.util

        // 加载菜单及按钮数据
        $.ajax({
            url: '/menu/queryMenuAndChild',
            type: 'POST',
            data: {'roleId':$('#tempMenuRoleId').attr('tempMenuRoleId')},
            success: function (res) {
                if (res.errorCode == '0') {
                    // res.data
                    tree.render({
                        elem: '#roleMenuData',
                        id:'roleMenuDataId',
                        data: res.data,
                        showCheckbox: true
                    });

                }else {
                    layer.msg(res.desc);
                }
            }
        });

    });

</script>

